#include "Thread.hpp"
#include <vector>
#include <unistd.h>

using namespace std;

void Print()
{
    while(1)
    {
        sleep(1);
        cout<<"hahaha,我是一个封装的线程"<<endl;
    }
}

int main()
{
    vector<Thread> threads;

    for(int i=0;i<3;i++)
    {
        threads.push_back(Thread(Print));
    }

    for(auto &t:threads)
    {
        t.Run();
    }

    for(auto& t:threads)
    {
        cout<<t.GetName()<<endl;
    }

    for(auto&t: threads)
    {
        t.join();
    }

    return 0;
}